//
//  LimitView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/2/28.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "LimitView.h"
#import <Masonry.h>
@implementation LimitView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    
    self.levelView = [[UIView alloc] init];
    self.levelView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.levelView];
    [self.levelView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.mas_equalTo(12);
        make.height.mas_equalTo(54);
    }];
    
    //刷卡额度
    self.levelTipsLab = [[UILabel alloc] init];
    self.levelTipsLab.text = @"当前等级:";
    self.levelTipsLab.font = [UIFont systemFontOfSize:14.0f];
    self.levelTipsLab.textColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1.0];
    [self.levelView addSubview:self.levelTipsLab];
    [self.levelTipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.centerY.equalTo(self.levelView);
        make.height.mas_equalTo(25);
    }];
    
    self.levelLab = [[UILabel alloc] init];
    self.levelLab.text = @"钻石会员";
    self.levelLab.font = [UIFont boldSystemFontOfSize:14.0];
    self.levelLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.levelView addSubview:self.levelLab];
    [self.levelLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.levelTipsLab.mas_right).offset(5);
        make.centerY.equalTo(self.levelView);
    }];
    
    
    self.swipeCardView = [[UIView alloc] init];
    self.swipeCardView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.swipeCardView];
    [self.swipeCardView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.equalTo(self).multipliedBy(0.24);
        make.top.equalTo(self.levelView.mas_bottom).offset(12);
    }];
    
    self.swipeCardLab = [[UILabel alloc] init];
    self.swipeCardLab.text = @"刷卡额度(元)";
    self.swipeCardLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    self.swipeCardLab.font = [UIFont boldSystemFontOfSize:14.0];
    [self.swipeCardView addSubview: self.swipeCardLab];
    [self.swipeCardLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.levelTipsLab);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(20);
    }];
    
    self.swipeCardLineView = [[UIView alloc] init];
    self.swipeCardLineView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 / 255.0 blue:229 / 255.0 alpha:1];
    [self.swipeCardView addSubview:self.swipeCardLineView];
    [self.swipeCardLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.swipeCardLab.mas_bottom).offset(10);
        make.height.mas_equalTo(1);
    }];
    
    
    self.swipeListView = [[UIView alloc] init];
    [self.swipeCardView addSubview:self.swipeListView];
    [self.swipeListView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.swipeCardLineView);
        make.bottom.equalTo(self.swipeCardView.mas_bottom);
    }];
    

    self.swipeCategoryLab = [[UILabel alloc] init];
    self.swipeCategoryLab.text = @"类别";
    self.swipeCategoryLab.textAlignment = NSTextAlignmentCenter;
    self.swipeCategoryLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeCategoryLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeCategoryLab];
    
    self.swipeSingleTimeLimitLab = [[UILabel alloc] init];
    self.swipeSingleTimeLimitLab.text = @"单笔限额";
    self.swipeSingleTimeLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeSingleTimeLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeSingleTimeLimitLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeSingleTimeLimitLab];
    
    self.swipeSingleDayLimitLab = [[UILabel alloc] init];
    self.swipeSingleDayLimitLab.text = @"单日卡限额";
    self.swipeSingleDayLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeSingleDayLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeSingleDayLimitLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeSingleDayLimitLab];
    
    self.swipeSingleMonthLimitLab = [[UILabel alloc] init];
    self.swipeSingleMonthLimitLab.text = @"单月限额";
    self.swipeSingleMonthLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeSingleMonthLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeSingleMonthLimitLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeSingleMonthLimitLab];
    
    NSMutableArray *array = [NSMutableArray array];
    [array addObject:self.swipeCategoryLab];
    [array addObject:self.swipeSingleTimeLimitLab];
    [array addObject:self.swipeSingleDayLimitLab];
    [array addObject:self.swipeSingleMonthLimitLab];
    
    [array mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [array mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.swipeCategoryLab);
    }];
    
    
    self.swipeDebitCardLab = [[UILabel alloc] init];
    self.swipeDebitCardLab.text = @"借记卡";
    self.swipeDebitCardLab.textAlignment = NSTextAlignmentCenter;
    self.swipeDebitCardLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeDebitCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeDebitCardLab];
    
    self.swipeDebitCardsingleTimeLimitLab = [[UILabel alloc] init];
    self.swipeDebitCardsingleTimeLimitLab.text = @"2000";
    self.swipeDebitCardsingleTimeLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeDebitCardsingleTimeLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeDebitCardsingleTimeLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeDebitCardsingleTimeLimitLab];
    
    self.swipeDebitCardsingleDayLimitLab = [[UILabel alloc] init];
    self.swipeDebitCardsingleDayLimitLab.text = @"20000";
    self.swipeDebitCardsingleDayLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeDebitCardsingleDayLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeDebitCardsingleDayLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeDebitCardsingleDayLimitLab];
    
    self.swipeDebitCardsingleMonthLimitLab = [[UILabel alloc] init];
    self.swipeDebitCardsingleMonthLimitLab.text = @"200000";
    self.swipeDebitCardsingleMonthLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeDebitCardsingleMonthLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeDebitCardsingleMonthLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeDebitCardsingleMonthLimitLab];
    
    NSMutableArray *debitArray = [NSMutableArray array];
    [debitArray addObject:self.swipeDebitCardLab];
    [debitArray addObject:self.swipeDebitCardsingleTimeLimitLab];
    [debitArray addObject:self.swipeDebitCardsingleDayLimitLab];
    [debitArray addObject:self.swipeDebitCardsingleMonthLimitLab];
    
    [debitArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [debitArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.swipeDebitCardLab);
    }];
    
    
    
    
    self.swipeCreditCardLab = [[UILabel alloc] init];
    self.swipeCreditCardLab.text = @"信用卡";
    self.swipeCreditCardLab.textAlignment = NSTextAlignmentCenter;
    self.swipeCreditCardLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeCreditCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeCreditCardLab];
    
    self.swipeCreditCardsingleTimeLimitLab = [[UILabel alloc] init];
    self.swipeCreditCardsingleTimeLimitLab.text = @"2000";
    self.swipeCreditCardsingleTimeLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeCreditCardsingleTimeLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeCreditCardsingleTimeLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeCreditCardsingleTimeLimitLab];
    
    self.swipeCreditCardsingleDayLimitLab = [[UILabel alloc] init];
    self.swipeCreditCardsingleDayLimitLab.text = @"20000";
    self.swipeCreditCardsingleDayLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeCreditCardsingleDayLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeCreditCardsingleDayLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeCreditCardsingleDayLimitLab];
    
    self.swipeCreditCardsingleMonthLimitLab = [[UILabel alloc] init];
    self.swipeCreditCardsingleMonthLimitLab.text = @"200000";
    self.swipeCreditCardsingleMonthLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeCreditCardsingleMonthLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeCreditCardsingleMonthLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeListView addSubview:self.swipeCreditCardsingleMonthLimitLab];
    
    NSMutableArray *creditArray = [NSMutableArray array];
    [creditArray addObject:self.swipeCreditCardLab];
    [creditArray addObject:self.swipeCreditCardsingleTimeLimitLab];
    [creditArray addObject:self.swipeCreditCardsingleDayLimitLab];
    [creditArray addObject:self.swipeCreditCardsingleMonthLimitLab];
    
    [creditArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [creditArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.swipeCreditCardLab);
    }];
    
    
    //竖向排列
    
    NSMutableArray *swipeVerticalArray = [NSMutableArray array];
    [swipeVerticalArray addObject:self.swipeCategoryLab];
    [swipeVerticalArray addObject:self.swipeDebitCardLab];
    [swipeVerticalArray addObject:self.swipeCreditCardLab];
    
    [swipeVerticalArray mas_distributeViewsAlongAxis:(MASAxisTypeVertical) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    
    
    //信用卡收款
    self.credictCardView = [[UIView alloc] init];
    self.credictCardView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.credictCardView];
    [self.credictCardView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.equalTo(self).multipliedBy(0.24);
        make.top.equalTo(self.swipeCardView.mas_bottom).offset(10);
    }];
    
     self.credictCardLab = [[UILabel alloc] init];
     self.credictCardLab.text = @"信用卡收款额度(元)";
     self.credictCardLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
     self.credictCardLab.font = [UIFont boldSystemFontOfSize:14.0];
     [self.credictCardView addSubview: self.credictCardLab];
     [self.credictCardLab mas_makeConstraints:^(MASConstraintMaker *make) {
     make.left.equalTo(self.swipeCardLab);
     make.top.equalTo(self.credictCardView).offset(10);
     make.height.mas_equalTo(20);
   }];
     
     self.credictCardLineView = [[UIView alloc] init];
     self.credictCardLineView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 / 255.0 blue:229 / 255.0 alpha:1];
     [self.credictCardView addSubview:self.credictCardLineView];
     [self.credictCardLineView mas_makeConstraints:^(MASConstraintMaker *make) {
     make.left.mas_equalTo(0);
     make.right.mas_equalTo(0);
     make.top.equalTo(self.credictCardLab.mas_bottom).offset(10);
     make.height.mas_equalTo(1);
  }];
    
    
    self.credictListView = [[UIView alloc] init];
    [self.credictCardView addSubview:self.credictListView];
    [self.credictListView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.credictCardLineView);
        make.bottom.equalTo(self.credictCardView.mas_bottom);
    }];
    
    
    self.credictCategoryLab = [[UILabel alloc] init];
    self.credictCategoryLab.text = @"类别";
    self.credictCategoryLab.textAlignment = NSTextAlignmentCenter;
    self.credictCategoryLab.font = [UIFont systemFontOfSize:13.0];
    self.credictCategoryLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictCategoryLab];
    
    self.credictSingleTimeLimitLab = [[UILabel alloc] init];
    self.credictSingleTimeLimitLab.text = @"单笔限额";
    self.credictSingleTimeLimitLab.textAlignment = NSTextAlignmentCenter;
    self.credictSingleTimeLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.credictSingleTimeLimitLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictSingleTimeLimitLab];
    
    self.credictSingleDayLimitLab = [[UILabel alloc] init];
    self.credictSingleDayLimitLab.text = @"单日卡限额";
    self.credictSingleDayLimitLab.textAlignment = NSTextAlignmentCenter;
    self.credictSingleDayLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.credictSingleDayLimitLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictSingleDayLimitLab];
    
    self.credictSingleMonthLimitLab = [[UILabel alloc] init];
    self.credictSingleMonthLimitLab.text = @"单月限额";
    self.credictSingleMonthLimitLab.textAlignment = NSTextAlignmentCenter;
    self.credictSingleMonthLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.credictSingleMonthLimitLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictSingleMonthLimitLab];
    
    NSMutableArray *credictArray = [NSMutableArray array];
    [credictArray addObject:self.credictCategoryLab];
    [credictArray addObject:self.credictSingleTimeLimitLab];
    [credictArray addObject:self.credictSingleDayLimitLab];
    [credictArray addObject:self.credictSingleMonthLimitLab];
    
    [credictArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [credictArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.credictCategoryLab);
    }];
    
    
    
    self.credictDebitCardLab = [[UILabel alloc] init];
    self.credictDebitCardLab.text = @"借记卡";
    self.credictDebitCardLab.textAlignment = NSTextAlignmentCenter;
    self.credictDebitCardLab.font = [UIFont systemFontOfSize:13.0];
    self.credictDebitCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictDebitCardLab];
    
    self.credictDebitCardsingleTimeLimitLab = [[UILabel alloc] init];
    self.credictDebitCardsingleTimeLimitLab.text = @"2000";
    self.credictDebitCardsingleTimeLimitLab.textAlignment = NSTextAlignmentCenter;
    self.credictDebitCardsingleTimeLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.credictDebitCardsingleTimeLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictDebitCardsingleTimeLimitLab];
    
    self.credictDebitCardsingleDayLimitLab = [[UILabel alloc] init];
    self.credictDebitCardsingleDayLimitLab.text = @"20000";
    self.credictDebitCardsingleDayLimitLab.textAlignment = NSTextAlignmentCenter;
    self.credictDebitCardsingleDayLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.credictDebitCardsingleDayLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictDebitCardsingleDayLimitLab];
    
    self.credictDebitCardsingleMonthLimitLab = [[UILabel alloc] init];
    self.credictDebitCardsingleMonthLimitLab.text = @"200000";
    self.credictDebitCardsingleMonthLimitLab.textAlignment = NSTextAlignmentCenter;
    self.credictDebitCardsingleMonthLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.credictDebitCardsingleMonthLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictDebitCardsingleMonthLimitLab];
    
    NSMutableArray *credicDebitArray = [NSMutableArray array];
    [credicDebitArray addObject:self.credictDebitCardLab];
    [credicDebitArray addObject:self.credictDebitCardsingleTimeLimitLab];
    [credicDebitArray addObject:self.credictDebitCardsingleDayLimitLab];
    [credicDebitArray addObject:self.credictDebitCardsingleMonthLimitLab];
    
    [credicDebitArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [credicDebitArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.credictDebitCardLab);
    }];
    
    
    self.credictCreditCardLab = [[UILabel alloc] init];
    self.credictCreditCardLab.text = @"信用卡";
    self.credictCreditCardLab.textAlignment = NSTextAlignmentCenter;
    self.credictCreditCardLab.font = [UIFont systemFontOfSize:13.0];
    self.credictCreditCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictCreditCardLab];
    
    self.credictCreditCardsingleTimeLimitLab = [[UILabel alloc] init];
    self.credictCreditCardsingleTimeLimitLab.text = @"2000";
    self.credictCreditCardsingleTimeLimitLab.textAlignment = NSTextAlignmentCenter;
    self.credictCreditCardsingleTimeLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.credictCreditCardsingleTimeLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictCreditCardsingleTimeLimitLab];
    
    self.credictCreditCardsingleDayLimitLab = [[UILabel alloc] init];
    self.credictCreditCardsingleDayLimitLab.text = @"20000";
    self.credictCreditCardsingleDayLimitLab.textAlignment = NSTextAlignmentCenter;
    self.credictCreditCardsingleDayLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.credictCreditCardsingleDayLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictCreditCardsingleDayLimitLab];
    
    self.credictCreditCardsingleMonthLimitLab = [[UILabel alloc] init];
    self.credictCreditCardsingleMonthLimitLab.text = @"200000";
    self.credictCreditCardsingleMonthLimitLab.textAlignment = NSTextAlignmentCenter;
    self.credictCreditCardsingleMonthLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.credictCreditCardsingleMonthLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.credictListView addSubview:self.credictCreditCardsingleMonthLimitLab];
    
    NSMutableArray *creditCreditArray = [NSMutableArray array];
    [creditCreditArray addObject:self.credictCreditCardLab];
    [creditCreditArray addObject:self.credictCreditCardsingleTimeLimitLab];
    [creditCreditArray addObject:self.credictCreditCardsingleDayLimitLab];
    [creditCreditArray addObject:self.credictCreditCardsingleMonthLimitLab];
    
    [creditCreditArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [creditCreditArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.credictCreditCardLab);
    }];
    
    //竖向排列

    NSMutableArray *creditVerticalArray = [NSMutableArray array];
    [creditVerticalArray addObject:self.credictCategoryLab];
    [creditVerticalArray addObject:self.credictDebitCardLab];
    [creditVerticalArray addObject:self.credictCreditCardLab];
    
    [creditVerticalArray mas_distributeViewsAlongAxis:(MASAxisTypeVertical) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    
    
    
    
    
    //银联收款
    self.unionpayView = [[UIView alloc] init];
    self.unionpayView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.unionpayView];
    [self.unionpayView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.equalTo(self).multipliedBy(0.24);
        make.top.equalTo(self.credictCardView.mas_bottom).offset(12);
    }];
    
    self.unionpayLab = [[UILabel alloc] init];
    self.unionpayLab.text = @"银联收款额度(元)";
    self.unionpayLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    self.unionpayLab.font = [UIFont boldSystemFontOfSize:14.0];
    [self.unionpayView addSubview: self.unionpayLab];
    [self.unionpayLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.levelTipsLab);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(20);
    }];
    
    self.unionpayLineView = [[UIView alloc] init];
    self.unionpayLineView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 / 255.0 blue:229 / 255.0 alpha:1];
    [self.unionpayView addSubview:self.unionpayLineView];
    [self.unionpayLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.unionpayLab.mas_bottom).offset(10);
        make.height.mas_equalTo(1);
    }];
    
    self.unionpayListView = [[UIView alloc] init];
    [self.unionpayView addSubview:self.unionpayListView];
    [self.unionpayListView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.unionpayLineView);
        make.bottom.equalTo(self.unionpayView.mas_bottom);
    }];
    
    
    self.unionpayCategoryLab = [[UILabel alloc] init];
    self.unionpayCategoryLab.text = @"类别";
    self.unionpayCategoryLab.textAlignment = NSTextAlignmentCenter;
    self.unionpayCategoryLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpayCategoryLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpayCategoryLab];
    
    self.unionpaySingleTimeLimitLab = [[UILabel alloc] init];
    self.unionpaySingleTimeLimitLab.text = @"单笔限额";
    self.unionpaySingleTimeLimitLab.numberOfLines = 0;
    self.unionpaySingleTimeLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unionpaySingleTimeLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpaySingleTimeLimitLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpaySingleTimeLimitLab];
    
    self.unionpaySingleDayLimitLab = [[UILabel alloc] init];
    self.unionpaySingleDayLimitLab.text = @"单日卡限额";
    self.unionpaySingleDayLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unionpaySingleDayLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpaySingleDayLimitLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpaySingleDayLimitLab];
    
    self.unionpaySingleMonthLimitLab = [[UILabel alloc] init];
    self.unionpaySingleMonthLimitLab.text = @"单月限额";
    self.unionpaySingleMonthLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unionpaySingleMonthLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpaySingleMonthLimitLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpaySingleMonthLimitLab];
    
    NSMutableArray *unionpayCategoryArray = [NSMutableArray array];
    [unionpayCategoryArray addObject:self.unionpayCategoryLab];
    [unionpayCategoryArray addObject:self.unionpaySingleTimeLimitLab];
    [unionpayCategoryArray addObject:self.unionpaySingleDayLimitLab];
    [unionpayCategoryArray addObject:self.unionpaySingleMonthLimitLab];
    
    [unionpayCategoryArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [unionpayCategoryArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.unionpayCategoryLab);
//        make.top.equalTo(self.unionpayLineView).offset(10);
    }];
    
    
    
    
    
    self.unionpayDebitCardLab = [[UILabel alloc] init];
    self.unionpayDebitCardLab.text = @"借记卡";
    self.unionpayDebitCardLab.textAlignment = NSTextAlignmentCenter;
    self.unionpayDebitCardLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpayDebitCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpayDebitCardLab];
    
    self.unionpayDebitCardsingleTimeLimitLab = [[UILabel alloc] init];
    self.unionpayDebitCardsingleTimeLimitLab.text = @"2000";
    self.unionpayDebitCardsingleTimeLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unionpayDebitCardsingleTimeLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpayDebitCardsingleTimeLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpayDebitCardsingleTimeLimitLab];
    
    self.unionpayDebitCardsingleDayLimitLab = [[UILabel alloc] init];
    self.unionpayDebitCardsingleDayLimitLab.text = @"20000";
    self.unionpayDebitCardsingleDayLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unionpayDebitCardsingleDayLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpayDebitCardsingleDayLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpayDebitCardsingleDayLimitLab];
    
    self.unionpayDebitCardsingleMonthLimitLab = [[UILabel alloc] init];
    self.unionpayDebitCardsingleMonthLimitLab.text = @"200000";
    self.unionpayDebitCardsingleMonthLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unionpayDebitCardsingleMonthLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpayDebitCardsingleMonthLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpayDebitCardsingleMonthLimitLab];
    
    NSMutableArray *unionpayDebitArray = [NSMutableArray array];
    [unionpayDebitArray addObject:self.unionpayDebitCardLab];
    [unionpayDebitArray addObject:self.unionpayDebitCardsingleTimeLimitLab];
    [unionpayDebitArray addObject:self.unionpayDebitCardsingleDayLimitLab];
    [unionpayDebitArray addObject:self.unionpayDebitCardsingleMonthLimitLab];
    
    [unionpayDebitArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [unionpayDebitArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.unionpayDebitCardLab);
//        make.top.equalTo(self.unionpayCategoryLab.mas_bottom).offset(10);
    }];
    
    
    self.unionpayCreditCardLab = [[UILabel alloc] init];
    self.unionpayCreditCardLab.text = @"信用卡";
    self.unionpayCreditCardLab.textAlignment = NSTextAlignmentCenter;
    self.unionpayCreditCardLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpayCreditCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpayCreditCardLab];
    
    self.unionpayCreditCardsingleTimeLimitLab = [[UILabel alloc] init];
    self.unionpayCreditCardsingleTimeLimitLab.text = @"2000";
    self.unionpayCreditCardsingleTimeLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unionpayCreditCardsingleTimeLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpayCreditCardsingleTimeLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpayCreditCardsingleTimeLimitLab];
    
    self.unionpayCreditCardsingleDayLimitLab = [[UILabel alloc] init];
    self.unionpayCreditCardsingleDayLimitLab.text = @"20000";
    self.unionpayCreditCardsingleDayLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unionpayCreditCardsingleDayLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpayCreditCardsingleDayLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpayCreditCardsingleDayLimitLab];
    
    self.unionpayCreditCardsingleMonthLimitLab = [[UILabel alloc] init];
    self.unionpayCreditCardsingleMonthLimitLab.text = @"200000";
    self.unionpayCreditCardsingleMonthLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unionpayCreditCardsingleMonthLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unionpayCreditCardsingleMonthLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unionpayListView addSubview:self.unionpayCreditCardsingleMonthLimitLab];
    
    NSMutableArray *unionpayCreditArray = [NSMutableArray array];
    [unionpayCreditArray addObject:self.unionpayCreditCardLab];
    [unionpayCreditArray addObject:self.unionpayCreditCardsingleTimeLimitLab];
    [unionpayCreditArray addObject:self.unionpayCreditCardsingleDayLimitLab];
    [unionpayCreditArray addObject:self.unionpayCreditCardsingleMonthLimitLab];
    
    [unionpayCreditArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [unionpayCreditArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.unionpayCreditCardLab);
//        make.top.equalTo(self.unionpayDebitCardLab.mas_bottom).offset(10);

    }];
    
    //竖向排列
    
    
    
    NSMutableArray *unionpayVerticalArray = [NSMutableArray array];
    [unionpayVerticalArray addObject:self.unionpayCategoryLab];
    [unionpayVerticalArray addObject:self.unionpayDebitCardLab];
    [unionpayVerticalArray addObject:self.unionpayCreditCardLab];
    
    [unionpayVerticalArray mas_distributeViewsAlongAxis:(MASAxisTypeVertical) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
   
     
}

@end
